package com.sc.nft.enums;

import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum UserChainLogStatusEnum {

    WAIT(1, "待执行"),
    IN_CHINA(2, "上链中"),
    SUCCESS(3, "完成"),
    FAIL(4, "失败"),

    ;
    @EnumValue
    private int code;
    private String description;

    public static UserChainLogStatusEnum of(int code) {
        return ArrayUtil.firstMatch(item -> item.getCode() == code, UserChainLogStatusEnum.values());
    }

}
